load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "fmtsafe",
    srcs = [
        "fmtsafe.go",
        "functions.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/fmtsafe",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/testutils/lint/passes/errwrap",
        "//pkg/util/log/logpb",
        "@com_github_cockroachdb_errors//:errors",
        "@org_golang_x_text//cases",
        "@org_golang_x_text//language",
        "@org_golang_x_tools//go/analysis",
        "@org_golang_x_tools//go/analysis/passes/inspect",
        "@org_golang_x_tools//go/ast/inspector",
        "@org_golang_x_tools//go/types/typeutil",
    ],
)

go_test(
    name = "fmtsafe_test",
    size = "small",
    srcs = ["fmtsafe_test.go"],
    data = glob(["testdata/**"]) + [
        "@go_sdk//:files",
    ],
    deps = [
        ":fmtsafe",
        "//pkg/build/bazel",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/skip",
        "@org_golang_x_tools//go/analysis/analysistest",
    ],
)
